<?php
require_once('../3rdparty/phpmailer/PHPMailer-master/class.phpmailer.php');

$mail = new PHPMailer();

$mail->IsSMTP();                       // telling the class to use SMTP

$mail->SMTPDebug = 1;                  
// 0 = no output, 1 = errors and messages, 2 = messages only.

$mail->SMTPAuth = true;                // enable SMTP authentication 
$mail->SMTPSecure = "tls";              // sets the prefix to the servier
$mail->Host = "smtp.gmail.com";        // sets Gmail as the SMTP server
$mail->Port = 587;                     // set the SMTP port for the GMAIL 

$mail->Username = "hello.kr.dev@gmail.com";  // Gmail username
$mail->Password = "download@256";      // Gmail password

$mail->CharSet = 'windows-1250';
$mail->SetFrom ('hello.kr.dev@gmail.com', 'hello.kr.dev');
$mail->AddBCC ( 'hello.kr.dev@gmail.com', 'hello.kr.dev'); 
$subject = "sending email from php client";
$mail->Subject = $subject;
$mail->ContentType = 'text/plain'; 
$mail->IsHTML(false);
$body_of_your_email = "This email is being sent from php client";
$mail->Body = $body_of_your_email; 
// you may also use $mail->Body = file_get_contents('your_mail_template.html');

$mail->AddAddress ('kamal.nandan@gmail.com', 'Kamal Nandan'); 
$mail->AddAttachment('composer.json', 'Composers list');
// you may also use this format $mail->AddAddress ($recipient);

if(!$mail->Send()) 
{
        $error_message = "Mailer Error: " . $mail->ErrorInfo;
} else 
{
        $error_message = "Successfully sent!";
}

print_r($error_message);

?>
